﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BLL.BusinessRules
{
    public class ValidateEmail:ValidateRegex
    {
        public ValidateEmail(string propertyName)
            : base(propertyName, @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*")
        {
            ErrorMessage = string.Format("{0} is not a valid email address", propertyName);
        }

        public ValidateEmail(string propertyName, string errorMessage)
            : this(propertyName)
        {
            ErrorMessage = errorMessage;
        }
    }
}
